package com.bw.mallshop.dao;

import androidx.annotation.NonNull;

import com.bw.mallshop.entity.CarListEntity;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class CarIterable implements Iterable<CarListEntity>{
    private List<CarListEntity.Values>list;

    public CarIterable(List<CarListEntity.Values>list){
        this.list = list;
    }

    @NonNull
    @Override
    public Iterator<CarListEntity> iterator() {
        List<CarListEntity>carList=new ArrayList<>();
        CarListEntity entity = new CarListEntity();
        entity.status = 0;
        entity.message = "获取成功";
        entity.data = list;
        carList.add(entity);
        return carList.iterator();
    }
}
